/* ไฟล์: assets/css/homepage.css */
/* CSS สำหรับหน้าแรกโรงเรียนเพี้ยนพินอนุสรณ์ (เฉพาะสไตล์หน้าแรกเท่านั้น) */

/* ==========================================
   Homepage Container
========================================== */
.homepage-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'Sarabun', sans-serif;
    line-height: 1.6;
}

/* ==========================================
   Hero Section
========================================== */
.hero-section {
    position: relative;
    height: 225px; /* ขนาดตามภาพปฏิทินข่าว Large */
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    overflow: hidden; 
    margin-bottom: 40px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-background.active {
    opacity: 0.4;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(30, 60, 114, 0.8), rgba(42, 82, 152, 0.6));
    z-index: 2;
    transition: background 0.3s ease;
}

.hero-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* จัดกลางแนวตั้ง */
    align-items: center; /* จัดกลางแนวนอน */
    text-align: center;
    padding: 10px 20px; /* ลด padding ลงเพื่อให้มีพื้นที่มากขึ้น */
    color: white;
}

.hero-welcome {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.8s forwards;
}

/* ส่วนของ Hero Slideshow Container */
.activities-slider-container {
    width: 100%;
    max-width: 100%;
    height: 100%; 
    opacity: 1;
    transform: none;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.activities-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* สไตล์สำหรับกลุ่มสไลด์ (activity-slide-group) ที่มี 2 การ์ด (ภาพ+ข้อความ) */
.activity-slide-group {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex; /* กำหนดให้เป็น Flexbox */
    flex-direction: row; /* จัดเรียงการ์ดย่อยในแนวนอน */
    justify-content: center; /* จัดกลางการ์ดย่อยในแนวนอน */
    align-items: center; /* จัดกลางการ์ดย่อยในแนวตั้ง */
    gap: 15px; /* ระยะห่างระหว่างการ์ดย่อย (ภาพ vs ข้อความ) */

    opacity: 0;
    transition: opacity 0.3s ease; /* Transition สำหรับการ fade in/out ของกลุ่มสไลด์ */
}

.activity-slide-group.active {
    opacity: 1;
    z-index: 1; /* ทำให้สไลด์ที่ active อยู่ด้านบน */
}

/* สไตล์พื้นฐานของการ์ดแต่ละใบใน Hero Slideshow */
.activity-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    /* padding: 15px; // ลบ padding ที่นี่แล้วไปกำหนดใน .activity-text-card แทน*/
    color: var(--text-dark);
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition-medium);
    height: 90%; /* ให้การ์ดสูงเกือบเต็มพื้นที่สไลด์ */
    display: flex; /* กำหนด Flexbox เพื่อควบคุมเนื้อหาภายใน Card */
    flex-direction: column; /* จัดเนื้อหาภายใน Card ในแนวตั้ง */
    justify-content: center; /* จัดกลางเนื้อหาภายใน Card */
    align-items: center; /* จัดกลางเนื้อหาภายใน Card */
    text-align: center; /* จัดข้อความกลาง */
    flex-basis: 48%; /* กำหนดความกว้างพื้นฐานประมาณครึ่งหนึ่ง (48% x 2 + 2% gap) */
    max-width: 600px; /* จำกัดความกว้างสูงสุดของการ์ดแต่ละใบ */
    position: relative; /* สำหรับ absolute positioning ของ debug info */
}

.activity-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-heavy);
}

/* สไตล์สำหรับ Card ที่เป็นรูปภาพล้วน */
.activity-image-card {
    padding: 0; /* ไม่ต้องมี padding ถ้าจะแสดงแค่รูป */
    background: transparent; /* ไม่ต้องมีพื้นหลังขาวถ้าจะเน้นรูป */
    box-shadow: none; /* ไม่ต้องมีเงา */
    backdrop-filter: none;
    border: none;
    overflow: hidden; /* ซ่อนส่วนที่เกิน */
    justify-content: center; /* จัดรูปภาพกลาง Card */
}

.activity-image-card .activity-card-image {
    width: 100%;
    height: 100%; /* ให้รูปภาพเต็มพื้นที่การ์ด */
    position: relative;
    border-radius: var(--border-radius-lg); /* โค้งมุมรูปภาพ */
    overflow: hidden; /* ซ่อนส่วนเกินของรูปภาพ */
}

.activity-image-card .activity-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ครอบคลุมพื้นที่ */
    transition: transform 0.3s ease;
}

.activity-image-card:hover .activity-card-image img {
    transform: scale(1.05);
}

.activity-image-card .no-image-placeholder {
    height: 100%; /* ให้ placeholder เต็มพื้นที่ */
    border-radius: inherit; /* ใช้ border-radius เดียวกัน */
    font-size: 3em;
    display: flex; /* เพื่อจัดกลางไอคอน */
    align-items: center;
    justify-content: center;
}


/* สไตล์สำหรับ Card ที่เป็นข้อความล้วน */
.activity-text-card {
    text-align: left; /* จัดข้อความชิดซ้าย */
    padding: 20px; /* เพิ่ม padding ด้านใน */
    background: rgba(255, 255, 255, 0.98); /* พื้นหลังขาวทึบกว่า */
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.5);
    justify-content: flex-start; /* จัดข้อความชิดด้านบน */
}

.activity-text-card .activity-card-image { /* ซ่อนส่วนรูปภาพในการ์ดข้อความ */
    display: none;
}

.activity-text-card .activity-card-content-wrapper {
    width: 100%; /* ให้ wrapper เต็มพื้นที่ */
    padding: 0; /* ลบ padding ภายใน wrapper ถ้ามี */
    text-align: inherit; /* ใช้ text-align ของ parent */
}

.activity-title {
    font-size: 1.8em;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-blue);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* จำกัด 2 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-subtitle {
    font-size: 1.1em;
    color: var(--text-medium);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* จำกัด 2 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-content-excerpt { /* คลาสใหม่สำหรับเนื้อหาสั้นๆ ใน Hero Card */
    font-size: 0.9em;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* จำกัด 3 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    width: 100%; /* ให้ meta กินพื้นที่เต็มความกว้าง */
}

/* สไตล์สำหรับสไลด์ข้อความต้อนรับ (welcome slide) */
.activity-card.welcome-slide {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0; left: 0; right: 0; width: 100%; height: 100%;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    border: none;
    color: white;
    opacity: 0;
    transform: translateX(100%);
    /* สไตล์เพิ่มเติมสำหรับ welcome slide เพื่อให้แสดงเต็มพื้นที่ */
    flex-basis: 100%; 
    max-width: none;
    padding: 0;
    /* ซ่อนการ์ดย่อยถ้าเป็น welcome slide */
    .activity-image-card, 
    .activity-text-card {
        display: none;
    }
    .activity-card-content-wrapper { /* แสดงเนื้อหาหลักของ welcome slide */
        display: block;
        width: auto;
        padding: 0;
    }
}

.activity-card.welcome-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.activity-card.welcome-slide .activity-meta {
    justify-content: center;
    border-top: none;
    padding-top: 0;
}
.activity-card.welcome-slide .activity-countdown {
    background: none;
    box-shadow: none;
    color: white;
    font-size: var(--font-size-base);
}
.activity-card.welcome-slide .activity-title,
.activity-card.welcome-slide .activity-subtitle {
    color: white;
}


/* Slide Animation Classes (คงเดิม) */
.activity-slide-group.slide-out-left {
    animation: slideOutLeft 0.3s ease-in forwards;
}
.activity-slide-group.slide-out-right {
    animation: slideOutRight 0.3s ease-in forwards;
}
.activity-slide-group.slide-in-left {
    animation: slideInLeft 0.3s ease-out forwards;
}
.activity-slide-group.slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

/* (Animations Keyframes ที่มีอยู่แล้วใน layout.css หรือ main.css) */

/* ==========================================
   Main Content Layout (Homepage Specific)
========================================== */
.main-content-layout {
    display: grid;
    /* ปรับให้คอลัมน์ซ้ายยืดหยุ่น และคอลัมน์ขวา (Sidebar) มีความกว้างคงที่ */
    grid-template-columns: 1fr 350px; /* 1fr สำหรับ left-column, 350px สำหรับ right-column */
    gap: 40px; /* ระยะห่างระหว่างคอลัมน์ */
    margin-bottom: 40px;
    /* เพิ่ม min-height เพื่อให้ layout มีพื้นที่เพียงพอที่จะแสดง sidebar */
    min-height: 800px; /* กำหนด min-height ขั้นต่ำ (ปรับตามความเหมาะสม) */
}

.left-column {
    min-width: 0; /* Prevents grid overflow */
    display: flex;
    flex-direction: column;
    gap: 25px; /* ระยะห่างระหว่าง sections ใน left-column */
}

.right-column {
    min-width: 0; /* Prevents grid overflow */
    display: flex;
    flex-direction: column;
    gap: 25px; /* ระยะห่างระหว่าง sections ใน right-column */
    /* ตรวจสอบว่าไม่มี display: none; หรือ visibility: hidden; ที่นี่ */
}

/* ==========================================
   News Sections (Homepage Specific)
========================================== */
.news-section {
    margin-bottom: 0; /* ลบ margin-bottom ออก แล้วไปจัดการที่ gap ของ flex/grid parent แทน */
    background: var(--bg-container);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    border: 1px solid var(--border-color-light);
}

.section-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    padding: 12px 20px; 
    position: relative;
}


.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}


.section-title {
    font-size: 1.13em; 
    font-weight: var(--font-weight-bold);
    margin: 0;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-icon {
    display: none;
    font-size: 1.2em;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* ==========================================
   Placeholder Content (Homepage Specific)
========================================== */
.placeholder-content {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.placeholder-icon {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

/* ==========================================
   Load More Section (Homepage Specific)
========================================== */
.load-more-section {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-family: 'Sarabun', sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-medium);
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.4);
}

/* ==========================================
   Sidebar Components (Homepage Specific)
========================================== */
.sidebar-section {
    background: var(--bg-container);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    margin-bottom: 0; /* ลบ margin-bottom ออก แล้วไปจัดการที่ gap ของ flex/grid parent แทน */
    overflow: hidden;
    border: 1px solid var(--border-color-light);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.sidebar-section:nth-child(1) { animation-delay: 0.1s; }
.sidebar-section:nth-child(2) { animation-delay: 0.3s; }
.sidebar-section:nth-child(3) { animation-delay: 0.5s; }

/* Director Section */
.director-content {
    padding: 25px;
    text-align: center;
}

.director-image {
    width: 180px; /* เพิ่มจาก 120px เป็น 180px */
    height: 240px; /* เพิ่มจาก 160px เป็น 240px (อัตราส่วน 3:4) */
    margin: 0 auto 20px;
    border-radius: var(--border-radius-small); 
    overflow: hidden;
    border: 4px solid var(--border-color-light);
    box-shadow: var(--shadow-light);
    position: relative;
    background: #f8f9fa;
}

.director-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.director-image:hover img {
    transform: scale(1.05);
}

.director-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--border-color-light) 0%, #f8f9fa 100%);
    color: var(--text-muted);
    font-size: 3em;
}

.director-name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.director-position {
    font-size: var(--font-size-base);
    color: var(--text-medium);
    margin-bottom: 15px;
    font-weight: var(--font-weight-medium);
}

.director-bio {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
    line-height: 1.5;
    text-align: left;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.director-bio::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, white);
}

.director-fallback {
    text-align: center;
    color: var(--text-medium);
    padding: 40px 20px;
}

.director-fallback-icon {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.director-fallback-text {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

/* ==========================================
   Calendar Components (Homepage Specific)
========================================== */
.calendar-content {
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.calendar-nav {
    background: var(--primary-blue); /* ใช้ primary-blue */
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-medium);
    box-shadow: 0 4px 10px rgba(30, 60, 114, 0.3);
}

.calendar-nav:hover {
    background: var(--primary-blue-light);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(30, 60, 114, 0.4);
}

.calendar-nav:active {
    transform: scale(0.95);
}

.current-month {
    font-size: 1.2em;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-blue);
    text-align: center;
    min-width: 180px;
}

.calendar-grid {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-light);
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
}

.day-header {
    padding: 12px 4px;
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: #495057;
    border-right: 1px solid var(--border-color-light);
}

.day-header:last-child {
    border-right: none;
}

.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-container);
}

.calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    border-right: 1px solid #f1f3f4;
    border-bottom: 1px solid #f1f3f4;
    position: relative;
    min-height: 40px;
}

.calendar-date:nth-child(7n) {
    border-right: none;
}

.calendar-date:hover {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: var(--font-weight-semibold);
}

.calendar-date.today {
    background: var(--primary-blue);
    color: white;
    font-weight: var(--font-weight-bold);
    box-shadow: inset 0 0 0 2px var(--primary-blue-light);
}

.calendar-date.today:hover {
    background: var(--primary-blue-light);
}

.calendar-date.other-month {
    color: #ccc;
    background: #fafafa;
}

.calendar-date.other-month:hover {
    background: #f0f0f0;
    color: #999;
}

.calendar-date.selected {
    background: var(--primary-blue-light);
    color: white;
    font-weight: var(--font-weight-semibold);
    box-shadow: inset 0 0 0 2px var(--primary-blue);
}

.calendar-date.has-activity {
    background: #fff3cd;
    color: #856404;
    font-weight: var(--font-weight-semibold);
    position: relative;
}

.calendar-date.has-activity::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ff6b6b;
    border-radius: 50%;
    box-shadow: 0 0 0 1px white;
}

.calendar-date.has-activity:hover {
    background: #ffeaa7;
}

.calendar-date.today.has-activity::after {
    background: #ffd93d;
}

/* Activity Tooltip */
.activity-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 5px;
}

.activity-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
}

.calendar-date:hover .activity-tooltip {
    opacity: 1;
}

/* ==========================================
   Online Learning Section (Homepage Specific)
========================================= */
.online-learning-content {
    padding: 25px;
    text-align: center;
}

.learning-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3em;
    position: relative;
    overflow: hidden;
}

.learning-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="tech" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23tech)"/></svg>') repeat;
}

.learning-title {
    font-size: 1.2em;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.learning-description {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 20px;
}

.learning-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-family: 'Sarabun', sans-serif;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-medium);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.learning-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   Animation Keyframes (Homepage Specific)
========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Hero Slide Animations */
/*
เหล่านี้ควรใช้กับ .activity-slide-group
เพื่อให้เกิดการสไลด์ของกลุ่มการ์ด
*/
@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   Responsive Header Styles
   (Media queries จะอยู่ใน responsive.css)
========================================== */

/* (ปรับปรุงโดยคำนึงถึงโครงสร้าง Flexbox ใหม่) */
@media (max-width: 768px) {
    .activity-slide-group {
        flex-direction: column; /* บนมือถือกลับไปเรียงแนวตั้ง */
        gap: 15px; /* ลด gap */
    }
    /* สไตล์การ์ดแต่ละใบใน Hero Slideshow บนมือถือ */
    .activity-card {
        flex-basis: 90%; /* การ์ดเต็มความกว้างมากขึ้น */
        max-width: none;
        height: auto; /* ปรับความสูงอัตโนมัติ */
        padding: 15px;
    }
    .activity-image-card {
        height: 180px; /* กำหนดความสูงรูปภาพบนมือถือ */
        padding: 0; /* ไม่มี padding */
    }
    .activity-text-card {
        padding: 15px; /* ลด padding */
    }
    .activity-image-card .activity-card-image {
        height: 100%; /* ให้รูปภาพเต็มพื้นที่ที่กำหนดให้ใน activity-image-card */
    }
}

@media (max-width: 480px) {
    .activity-card {
        padding: 10px; /* ลด padding อีก */
    }
    .activity-image-card {
        height: 150px; /* ลดความสูงรูปภาพบนมือถือเล็ก */
    }
    .activity-text-card {
        padding: 10px; /* ลด padding อีก */
    }
    .activity-title {
        font-size: 1.5em; /* ลดขนาด font */
    }
    .activity-subtitle {
        font-size: 1em; /* ลดขนาด font */
    }
}
/* ==========================================
   Sidebar Components (Homepage Specific)
========================================== */
.sidebar-section {
    background: var(--bg-container);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    margin-bottom: 0; /* ลบ margin-bottom ออก แล้วไปจัดการที่ gap ของ flex/grid parent แทน */
    overflow: hidden;
    border: 1px solid var(--border-color-light);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.sidebar-section:nth-child(1) { animation-delay: 0.1s; }
.sidebar-section:nth-child(2) { animation-delay: 0.3s; }
.sidebar-section:nth-child(3) { animation-delay: 0.5s; }

/* Director Section */
/* ... (ส่วนนี้เหมือนเดิม) ... */

/* ==========================================
   Announcement Content (สำหรับประกาศสำคัญ/ลิงก์ด่วน)
========================================== */
.announcement-content {
    padding: 25px; /* คง padding เดิม หรือปรับตามต้องการ */
    text-align: center;
    
    /* --- เพิ่ม/ปรับปรุงตรงนี้เพื่อเพิ่มความสูง --- */
    min-height: 475px; /* เพิ่ม min-height เป็นประมาณ 250px (ประมาณ 2 เท่าของ 100-120px เดิม) */
    display: flex; /* ใช้ flexbox เพื่อจัดเนื้อหาภายในให้ยืดหยุ่น */
    flex-direction: column; /* จัดเรียงเนื้อหาในแนวตั้ง */
    justify-content: center; /* จัดกลางเนื้อหาในแนวตั้ง */
    align-items: center; /* จัดกลางเนื้อหาในแนวนอน */
}

/* ... (โค้ดส่วนอื่นๆ ด้านล่างเหมือนเดิม) ... */

/* ==========================================
   Responsive Header Styles
   (Media queries จะอยู่ใน responsive.css)
========================================== */

/* (ปรับปรุงโดยคำนึงถึงโครงสร้าง Flexbox ใหม่) */
@media (max-width: 768px) {
    /* ... (โค้ดส่วน responsive เดิม) ... */

    /* ปรับ announcement-content บนมือถือ */
    .announcement-content {
        min-height: 180px; /* ลด min-height ลงสำหรับหน้าจอมือถือ */
        padding: 15px;
    }
}

@media (max-width: 480px) {
    /* ... (โค้ดส่วน responsive เดิม) ... */

    /* ปรับ announcement-content บนมือถือเล็ก */
    .announcement-content {
        min-height: 150px; /* ลด min-height ลงอีกสำหรับหน้าจอเล็กมาก */
        padding: 10px;
    }
}

